﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;
using repliback4.Misc;
using repliback4.Net.ServerSide;
using Tools.Debugging;
using repliback4.Net.Protocol.Messages;
namespace repliback4.Net.Protocol.InfoQueryHandling.ServerSide {
    public class ServerInfoQueryHandlerManager : InfoQueryHandlerManager<ServerInfoQueryHandler, QueryFromClient,Client> {
        Server server;
        public Server Server { get { return this.server; } }
        public ServerInfoQueryHandlerManager ( Server server ) {
            Logger.Created( this );
            this.server = server;
        }
        //public void Handle ( QueryFromClient item ) {
        //    ServerInfoQueryHandler handler;
        //    //InfoQueryHandler handler;
        //    String queryName = item.Query.Query.GetType( ).GetReplibackTagName( );
        //    Logger.Debug( this, "handling query {0}", queryName );

        //    if ( this.table.TryGetValue( queryName, out handler ) ) {

        //        try {
        //            handler.Handle( item );
        //        } catch ( Exception e ) {
        //            Logger.Exception( this, "ServerInfoQueryHandlerManager Handler exception", e );
        //            this.HandleHandlerException( item );
        //        }
        //    } else {
        //        this.HandleNotImplemented( item );
        //    }
        //}

        //private void HandleHandlerException ( QueryFromClient item ) {
        //    Logger.Debug( this, "will send general-error" );
        //}

        //private void HandleNotImplemented ( QueryFromClient item ) {
        //    Logger.Debug( this, "will send feature-not-implemented" );

        //    //<iq type="error" id="aac1a" to="sszymbor@gmail.com/gTalk-thea349E3814" >
        //    //<query xmlns="jabber:iq:kot"/>
        //    //<error type="cancel" code="501" >
        //    //<feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
        //    //</error>
        //    //</iq>             

        //}



    }
}
